import { Empty, FormInstance } from 'antd'
export const searchConfig = ({
  SpuOptions,
  SupplierOptionF,
  SupplierOptionC,
  handleSearchSupplierF,
  handleSearchSupplierC,
  handleSearchSpuOptions,
  ProDevSeason,
  classBig,
}: {
  SpuOptions: IOptionItem[]
  SupplierOptionF: IOptionItem[]
  SupplierOptionC: IOptionItem[]
  ProDevSeason: IOptionItem[]
  handleSearchSupplierF: (newVal: string) => void
  handleSearchSupplierC: (newVal: string) => void
  handleSearchSpuOptions: (newVal: string) => void
  form: FormInstance
  classBig: IOptionItem[]
}): IItemArray[] => {
  return [
    {
      name: 'seasonId',
      label: '开发季',
      type: 'Select',
      option: ProDevSeason,
      placeholder: '请选择开发季',
      config: {
        showSearch: true,
        optionFilterProp: 'label',
      },
    },
    {
      label: '面料编码',
      name: 'fabricCodeList',
      placeholder: '多个编码间需要换行或使用","分隔',
      type: 'Select',
      config: {
        mode: 'tags',
        maxTagCount: 'responsive',
        tokenSeparators: [',', '，', '\n', '\r', '\r\n'],
        notFoundContent: null,
      },
    },
    {
      name: 'fabricTypeCode',
      label: '面种编码',
      type: 'Input',
      placeholder: '请输入面种编码',
    },
    {
      label: '面料下单时间',
      name: 'createTimeStart',
      type: 'FixedRangePicker',
      config: { showTime: true, customFormat: 'YYYY-MM-DD HH:mm:ss' },
    },
    {
      label: '大类',
      name: 'bigClassIds',
      type: 'Select',
      option: classBig,
      config: {
        showSearch: true,
        optionFilterProp: 'label',
        mode: 'multiple',
        maxTagCount: 'responsive',
      },
    },
    {
      name: 'supplierCode',
      label: '面料供应商',
      type: 'Select',
      option: SupplierOptionF,
      config: {
        suffixIcon: null,
        showSearch: true,
        optionFilterProp: 'label',
        filterOption: false,
        onSearch: handleSearchSupplierF,
        notFoundContent: <Empty description="请输入内容搜索" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
      },
    },
    {
      name: 'productSupplierCode',
      label: '成衣供应商',
      type: 'Select',
      option: SupplierOptionC,
      config: {
        suffixIcon: null,
        showSearch: true,
        optionFilterProp: 'label',
        filterOption: false,
        onSearch: handleSearchSupplierC,
        notFoundContent: <Empty description="请输入内容搜索" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
      },
    },
    {
      label: 'SPU商品',
      name: 'spuCode',
      type: 'Select',
      placeholder: '款式编码/款式名称/设计编码/厂家款号',
      option: SpuOptions,
      config: {
        suffixIcon: null,
        showSearch: true,
        optionFilterProp: 'label',
        filterOption: false,
        onSearch: handleSearchSpuOptions,
        notFoundContent: <Empty description="请输入内容搜索" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
      },
    },
    {
      label: '采购订单号',
      name: 'purchaseOrderCodes',
      placeholder: '多个单号间需要换行或使用","分隔',
      type: 'Select',
      config: {
        mode: 'tags',
        maxTagCount: 'responsive',
        tokenSeparators: [',', '，', '\n', '\r', '\r\n'],
        notFoundContent: null,
      },
    },
    {
      name: 'colorFabricCode',
      label: '色布编码',
      type: 'Input',
      placeholder: '请输入色布编码',
    },
    {
      name: 'replyDateStatus',
      label: '交期回复状态',
      type: 'Select',
      option: [
        { label: '待回复', value: 0 },
        { label: '已回复', value: 1 },
      ],
      placeholder: '请选择交期回复状态',
      config: {
        showSearch: true,
        filterOption: true,
        optionFilterProp: 'label',
      },
    },
  ]
}
